<div class="underlying">
  <div class="table">
    <div class="bbs">
      <!-- 增加button -->
      <button class="btn_add" (click)="showinput()"></button>
    </div>
    <!-- 头部Table -->
    <nz-table #headerTable
      style="border-collapse: collapse; border-radius: 4px 4px 0px 0px;"
      [nzData]="listOfData" class="designTable" [nzShowPagination]='false'
      [nzScroll]="{ y: '700px' }">
      <thead class="tableHeard">
        <tr style="text-align: center !important;">
          <th nzWidth="100px"></th>
          <th nzWidth="100px"></th>
          <th nzWidth="200px">廠商全名</th>
          <th style="flex: 1;text-align: left;text-indent:30px;">稅率</th>
        </tr>
      </thead>
      <!-- 工联单Table -->
      <tbody class="tablecontent" style="border-left: 1px solid rgba(71,156,156,1) !important;">
        <!-- 新增 -->
        <tr class="tr_hover" id="addcnc" *ngIf="isShow">
          <!-- 确认按钮 -->
          <td style="padding:5px 8px;">
            <button nz-button [nzType]="'primary'" class="confirmAdd" (click)="confirmAdd()"></button>
          </td>
          <!-- 取消按钮 -->
          <td style="padding:5px 8px;">
            <button nz-button [nzType]="'primary'" class="cancelAdd" (click)="cancelAdd()"></button>
          </td>
          <td class="input_first" style="padding:5px 8px;"><input [(ngModel)]="fullname" (ngModelChange)="pushFullname()" style="width: 200px;text-indent: 12px;" name=''></td>
          <td class="input_first" style="padding:5px 8px; text-align: left;text-indent: 22px;"><input [(ngModel)]="tax_rate" style="width: 100px;text-indent: 12px;" name=''></td>
        </tr>
        <tr id="first" *ngFor="let item of listOfData let key = index">
          <!-- 编辑按钮 -->
          <td>
            <div class="editable-row-operations">
              <ng-container *ngIf="editCache[key].edit; else saveTpl">
                <a (click)="startEdit(key)"><img src="../../../assets/image/icon_edit_white.svg"></a>
              </ng-container>
              <ng-template #saveTpl>
                <a (click)="saveEdit(key)"><img src="../../../assets/image/icon_ok.svg"></a>
              </ng-template>
            </div>
          </td>
          <!-- 删除按钮 -->
          <td>
            <button nz-button [nzType]="'primary'" class="del" *ngIf="editCache[key].isdel" (click)="showModal(item)"></button>
            <a (click)="cancelEdit(key)" *ngIf="!editCache[key].edit"><img src="../../../assets/image/icon_cancel.svg"></a>
          </td>
          <!--廠商全名  -->
          <td class="input_first">
            <ng-container *ngIf="editCache[key].edit; else fullname">
              {{item.fullname}}
            </ng-container>
            <ng-template #fullname>
              <input style="width: 200px;color:#ffffff;" type="text" nz-input
                [(ngModel)]="editCache[key]['data'].fullname" />
            </ng-template>
          </td>
          <!-- 稅率 -->
          <td class="input_first" style="flex: 1;text-align: left;text-indent:60px;">
            <ng-container *ngIf="editCache[key].edit; else tax_rate">
              {{item.tax_rate}}
            </ng-container>
            <ng-template #tax_rate>
              <input style="width: 100px;color:#ffffff;" type="text" nz-input
                [(ngModel)]="editCache[key]['data'].tax_rate" />
            </ng-template>
          </td>
        </tr>
      </tbody>
    </nz-table>
    <!-- 删除弹出框-->
    <nz-modal [(nzVisible)]="isVisible" nzTitle="刪除" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"
      [nzMaskStyle]="{backgroundColor:'rbga(48,73,77,.05)'}"
      [nzBodyStyle]="{height:'200px',background:'rgba(31,46,49,1)',color:'#ffffff',fontSize:'20px',fontWight:'300',textAlign:'center',lineHeight:'200px'}">
      <p>確定刪除嗎？</p>
    </nz-modal>
  </div>
</div>
